import Home from '@/views/Home'
import ShopFooter from '@/components/ShopFooter'

const Mall = () => import('@/views/Mall')
const shopCategroy = () => import('@/components/shopCategroy')
const Cart = () => import('@/views/Cart')
const Mypage = () => import('@/views/Mypage')
const Detail = () => import('@/views/Detail')

const routs = [
  {
    path: '/',
    redirect: '/Home',
    meta: {
      isTabbar: false
    }
  },
  {
    path: '/home',
    name: 'Home',
    components: {
      default: Home,
      'shop-footer': ShopFooter
    },
    meta: {
      isTabbar: true,
      title: '首页',
      icon: 'home-o'
    }
  },
  {
    path: '/mall',
    name: 'Mall',
    components: {
      default: Mall,
      'shop-footer': ShopFooter
    },
    meta: {
      isTabbar: true,
      title: '商城',
      icon: 'shop-o'
    },
    children: [
      {
        path: ':id',
        component: shopCategroy
      }
    ]
  },
  {
    path: '/cart',
    name: 'Cart',
    components: {
      default: Cart,
      'shop-footer': ShopFooter
    },
    meta: {
      isTabbar: true,
      title: '购物车',
      icon: 'shopping-cart-o'
    }
  },
  {
    path: '/mypage',
    name: 'Mypage',
    components: {
      default: Mypage,
      'shop-footer': ShopFooter
    },
    meta: {
      isTabbar: true,
      title: '我的',
      icon: 'friends-o'
    }
  },
  {
    path: '/detail',
    name: 'Detail',
    component: Detail,
    meta: {
      isTabbar: false
    }
  }
]

export default routs
